package com.zzg.demo.springbatch.demo.customer;

import com.zzg.demo.springbatch.demo.bean.PersonEntity;
import lombok.extern.slf4j.Slf4j;
import org.springframework.batch.core.ItemReadListener;

@Slf4j
public class MyReadListener implements ItemReadListener<PersonEntity> {
    @Override
    public void beforeRead() {
        log.info("MyReadListener-beforeRead");
    }

    @Override
    public void afterRead(PersonEntity item) {
        log.info(String.format("MyReadListener-afterRead-%s", item));
    }

    @Override
    public void onReadError(Exception ex) {
        log.error(String.format("MyReadListener-onReadError-%s", ex.getMessage()));
    }
}
